package com.company.project.builder.wx.outxml;

import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
import me.chanjar.weixin.mp.bean.message.WxMpXmlOutVideoMessage;

/**
 * @author xsk
 */
public class VideoBuilder  {

    /***
     *
     * @param mediaId
     * @param title 可选
     * @param description 可选
     * @param wxMessage
     * @return
     */
    public WxMpXmlOutMessage build(String mediaId , String title , String description , WxMpXmlMessage wxMessage) {

        me.chanjar.weixin.mp.builder.outxml.VideoBuilder vb = WxMpXmlOutMessage.VIDEO()
                .mediaId(mediaId)
                .fromUser(wxMessage.getToUser())
                .toUser(wxMessage.getFromUser());

        if(title != null)
            vb.title(title);
        if(description != null)
            vb.description(description);

        WxMpXmlOutVideoMessage m = vb.build();

        return m;
    }

}
